<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添加与会人员</title>
<link href="../../css/style.css" rel="stylesheet" type="text/css">
<script language="javascript">
function clickOk()
{
	var arr=new Array(document.form1.selectBasLeft.length);
	for(var i=0;i<arr.length;i++)
	{
		arr[i]=document.form1.selectBasLeft.options[i].value;
	}
	window.returnValue = arr;
	window.close();
}
function makeValue(){
document.getElementById("dept").options.length=0;
if(document.getElementById("select").value==1)
{
	document.getElementById("dept").options.length=0;
	document.getElementById("dept").options.add(new Option("张三","张三")); 
	document.getElementById("dept").options.add(new Option("李四","李四")); 
	document.getElementById("dept").options.add(new Option("王五","王五")); 
}
if(document.getElementById("select").value==2)
{
	document.getElementById("dept").options.length=0;
	document.getElementById("dept").options.add(new Option("小李","小李")); 
	document.getElementById("dept").options.add(new Option("小王","小王")); 
	document.getElementById("dept").options.add(new Option("小猪","小猪")); 
}
}
function BasMove (nType)
{
    switch (nType)
    {
        case 0:
            OrtSelectMove (document.form1.selectBasRight, document.form1.selectBasLeft, 0);
            break;
        case 1:
            OrtSelectMove (document.form1.selectBasLeft, document.form1.selectBasRight, 0);
            break;
        case 2:
            OrtSelectMoveAll (document.form1.selectBasRight, document.form1.selectBasLeft, 0);
            break;
        case 3:
            OrtSelectMoveAll (document.form1.selectBasLeft, document.form1.selectBasRight, 0);
            break;
    }
}

 function OrtSelectMoveAll (Source, Target, Start)
{
    var eItem;
    if (Start < 0)
        Start = 0;
    if (Source.length < Start)
        return;
    while (Source.length > Start)
    {
        if (Target != null)
        {
            eItem = document.createElement ("OPTION");
            Target.add (eItem);
            eItem.innerText = Source.item (Start).text;
            eItem.value = Source.item (Start).value;
        }
        Source.remove (Start);
    }
    Source.selectedIndex = -1;
    if (Target != null)
        Target.selectedIndex = Target.length - 1;
}
function OrtSelectMove (Source, Target, Start)
{
    var nIndex;
    var eItem;
    if (Start < 0)
        Start = 0;
    nIndex = Source.selectedIndex;
    if (nIndex < Start)
        return;
    if (Target != null)
    {
        eItem = document.createElement ("OPTION");
        Target.add (eItem);
        eItem.innerText = Source.item (nIndex).text;
        eItem.value = Source.item (nIndex).value;
        Target.selectedIndex = Target.length - 1;
    }
    Source.remove (nIndex);
    if (nIndex >= Source.length)
        nIndex = Source.length - 1;
    Source.selectedIndex = nIndex;
}
</script>
</head>

<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<form name="form1" action="post">
<table width="100%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="2%" valign="middle" background="../../images/bg_03.gif">&nbsp;</td>
    <td width="2%" valign="middle" background="../../images/bg_03.gif"><img src="../../images/main_28.gif" width="9" height="9" align="absmiddle"></td>
    <td height="30" valign="middle" background="../../images/bg_03.gif"><div align="left"><font color="#FFFFFF">添加与会人员</font></div></td>
  </tr>
</table>
<br>
<table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td class="td_page">
      <table width="100%"  border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="45%">与会人员</td>
          <td width="10%">&nbsp;</td>
          <td height="30"><span class="style4">
</span>
            <table width="100%"  border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="10%">部门</td>
                <td width="40%"><span class="style4">
                  <select name="select" id="select" class="box" style="width:100px " onChange="makeValue()">
                    <option value="0" selected>部门选择</option>
                    <option value="1">人事部</option>
                    <option value="2">工程部</option>
                  </select>
                </span></td>
                <td width="10%">职位</td>
                <td><span class="style4">
                  <select name="select" style="width:100px ">
                    <option value="0" selected>职位选择</option>
                    <option value="1">部门经理</option>
                  </select>
                </span></td>
              </tr>
            </table>
            <span class="style4">          </span></td>
        </tr>
        <tr>
          <td><select name="selectBasLeft" size="16" multiple style="width:100% ">
          </select></td>
          <td><table width="100%" height="100%"  border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td height="45"><div align="center"><img alt="向左" style="cursor:hand " src="../../images/arrow_left.gif" onClick="BasMove(0)" width="32" height="32"></div></td>
            </tr>
            <tr>
              <td height="45"><div align="center"><img alt="向右" style="cursor:hand " src="../../images/arrow_right.gif" onClick="BasMove(1)" width="32" height="32"></div></td>
            </tr>
            <tr>
              <td height="45"><div align="center"><img alt="全部向左" style="cursor:hand " src="../../images/arrow_leftall.gif" onClick="BasMove(2)" width="32" height="32"></div></td>
            </tr>
            <tr>
              <td height="45"><div align="center"><img alt="全部向右" style="cursor:hand " src="../../images/arrow_rightall.gif" onClick="BasMove(3)" width="32" height="32"></div></td>
            </tr>
          </table></td>
          <td><select name="selectBasRight" size="16" multiple style="width:100% " id="dept">
          </select></td>
        </tr>
      </table>
</td>
  </tr>
</table><br>
<table width="95%"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td class="td_page">
      <div align="center">
        <input name="Submit" type="button" class="buttonface02" value="  确定  " onClick="clickOk()">
        <input name="Submit2" type="reset" class="buttonface02" value="  关闭  ">
      </div></td></tr>
</table>
</form>
</body>
</html>
